-----------------------------------
-- Area: Al'Taieu
-- NPC: Crystalline Field
-- @zone 33
-- @pos 0.001 -12.500 -460.000
-----------------------------------
package.loaded["scripts/zones/AlTaieu/TextIDs"] = nil;
-----------------------------------

require("scripts/zones/AlTaieu/TextIDs");
require("scripts/globals/missions");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

	if(player:getCurrentMission(COP) == GARDEN_OF_ANTIQUITY and player:getVar("PromathiaStatus")==1)then
		player:startEvent(0x00A4);
	else
		player:startEvent(0x0064);
	end
	return 1;
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
	-- printf("CSID: %u",csid);
	-- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
	-- printf("CSID: %u",csid);
	-- printf("RESULT: %u",option);

	if(csid == 0x0064 and option == 1) then
		player:setPos(-20,0.624,-355,191,34); -- {R}
	elseif(csid == 0x00A4)then	
	    player:setVar("PromathiaStatus",2);
	end

end;